import { InjectionKey } from 'vue'
import { createStore, useStore as baseUseStore, Store } from 'vuex'
import appInfo from './modules/app';
import { IRootState } from './rootState';

export const key: InjectionKey<Store<IRootState>> = Symbol();

const store = createStore<IRootState>({
    modules: {
        appInfo
    }
})
// 定义自己的 `useStore` 组合式函数
export function useStore() {
    return baseUseStore(key)
}
export default store;